import request from '@/utils/http'

/**
 * 搜索用户
 */
export function apiSearchUser(params: any) {
  return request.get({
    url: '/user/search_user',
    params
  })
}

/**
 * 添加用户
 */
export function apiAddUser(params: any) {
  return request.post({
    url: '/user/add_user',
    params,
    headers: {
      'Content-Type': 'application/x-www-form-urlencoded'
    }
  })
}

/**
 * 编辑用户
 */
export function apiEditUser(params: any) {
  return request.put({
    url: '/user/edit_user',
    params,
    headers: {
      'Content-Type': 'application/x-www-form-urlencoded'
    }
  })
}

/**
 * 获取用户详情
 */
export function apiGetUser(params: any) {
  return request.get({
    url: '/user/get_user',
    params
  })
}

/**
 * 删除用户
 */
export function apiDeleteUser(params: any) {
  return request.del({
    url: '/user/delete_user',
    params,
    headers: {
      'Content-Type': 'application/x-www-form-urlencoded'
    }
  })
}
